<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>海创数字</title>
<link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
<link href="__PUBLIC__/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="__PUBLIC__/css/plugins/uploadify/uploadify.css" rel="stylesheet">
<link href="__PUBLIC__/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
<link href="__PUBLIC__/css/animate.css" rel="stylesheet">
<link href="__PUBLIC__/css/style.css" rel="stylesheet">
</head>
<body class="skin-1">
	<div id="wrapper">
		<include file="default:left" />
		<div id="page-wrapper" class="gray-bg">
			<include file="default:header" />
			<div class="row wrapper border-bottom white-bg page-heading">
				<div class="col-lg-10">
					<h2>广告列表</h2>
					<ol class="breadcrumb">
						<li><a href="?c=index&a=index">管理平台</a></li>
						<li><a href="?c=admanage&a=index">广告管理</a></li>
						<li class="active"><strong>修改广告</strong></li>
					</ol>
				</div>
				<div class="col-lg-2"></div>
			</div>
			<div class="wrapper wrapper-content animated fadeIn">

				<div class="row ecommerce">
					<div class="col-lg-12">
						<div class="tabs-container m-b-lg">
							<ul class="nav nav-tabs">
								<li class="active"><a href="javascript:;">广告信息</a></li>
							</ul>
							<div class="tab-content">
								<!--tab1-->
								<div class="tab-pane active">
									<div class="panel-body">
										<form enctype="multipart/form-data" class="validation">
											<div class="row">
												<div class="col-sm-5">
													<fieldset class="form-horizontal">
														<div class="form-group" id="validation_title">
															<input style="display:none;" id="ad_id" value="{$adInfo.id}"/>
															<label class="col-sm-4 control-label">广告主题:</label>
															<div class="col-sm-8">
																<input
																	class="form-control validate[required,minSize[1],maxSize[30]]"
																	name="ad_title" value="{$adInfo.title}" type="text"> <span
																	class="help-block m-b-none">请输入1~30个字（必填）。</span>
															</div>
														</div>														
														<div class="form-group" id="validation_weight">
															<label class="col-sm-4 control-label">广告权重:</label>
															<div class="col-sm-8">
																<input
																	class="form-control validate[required,minSize[1],maxSize[2]]"
																	name="ad_weight" value="{$adInfo.weight}" type="text"> <span
																	class="help-block m-b-none">请输入数字（必填）。</span>
															</div>
														</div>	
														<div class="form-group">
															<label class="col-sm-4 control-label">广告链接:</label>
															<div class="col-sm-8">
																<input
																	class="form-control"
																	name="ad_link" value="{$adInfo.link}" type="text"> <span
																	class="help-block m-b-none">请输广告的超级链接。</span>
															</div>
														</div>
														<div class="form-group" id="validation_url">
															<label class="col-sm-4 control-label">广告地址:</label>
															<div class="col-sm-8">
																<input class="form-control" name="ad_fileurl" value="{$adInfo.url}" readonly="readonly" type="text">
															</div>
														</div>
														<div class="form-group">
		                                    				<div class="col-sm-8 col-sm-offset-4">
				                               		 			<div style="height: 30px; width: 120px;" class="uploadify" id="file_upload"><div style="height: 30px; line-height: 30px; width: 120px;" class="uploadify-button " id="file_upload-button"><span class="uploadify-button-text">上传文件</span></div></div><div class="uploadify-queue" id="file_upload-queue"></div>
				                                				<span class="help-block m-b-none">目前只支持'jpg', 'gif', 'png'文件。</span>
		                                    				</div>
		                                				</div>												
														<!--提交按钮-->
														<div class="col-sm-12 text-center m-t m-b-lg">
															<button type="submit"
																class="btn btn-lg btn-w-m btn-danger ladda-button submit_btn"
																data-loading-text="提交中...">提交保存</button>
														</div>
													</fieldset>
												</div>
											</div>
										</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>

			</div>
		</div>
	</div>
		<!-- Mainly scripts -->
		<script src="__PUBLIC__/js/jquery-2.1.1.js"></script>
		<script src="__PUBLIC__/js/bootstrap.min.js"></script>
		<script src="__PUBLIC__/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script src="__PUBLIC__//js/uploadPreview.js"></script>
		<script src="__PUBLIC__/js/v_post.js"></script>
		<script src="__PUBLIC__/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<script src="__PUBLIC__/js/menu.js"></script>		
		
		<!-- Custom and plugin javascript -->
		<script src="__PUBLIC__/js/inspinia.js"></script>
		<script src="__PUBLIC__/js/plugins/pace/pace.min.js"></script>
		<script src="__PUBLIC__/js/plugins/uploadify/jquery.uploadify.min.js"></script>
		<script src="__PUBLIC__/js/admanage/modify.js"></script>	
		
		<script type="text/javascript">

		<?php $timestamp = time();?>
		$(function() {
			$('#file_upload').uploadify({
				'formData'     : {
					'timestamp' : '<?php echo $timestamp;?>',
					'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
				},
		        "buttonText"      : "上传文件",
				'swf'      : '__PUBLIC__/js/plugins/uploadify/uploadify.swf',
				'uploader' : '__PUBLIC__/js/plugins/uploadify/uploadify.php',
				'fileTypeExts'      : '*.jpg; *.png; *.gif;',
				"onUploadSuccess" : uploadPicture
			});
		});
		
		//可以根据自己的要求来做相应处理
	    function uploadPicture(file, data){
	        if(data != '0'){
	            $("input[name='ad_fileurl']").val(data);
	        }
	    }    

		</script>
			</body>
			</html>
		